package com.ykq.controller;

import com.ykq.util.CommonResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: 145ssm
 * @description:
 * @author: 闫克起2
 * @create: 2021-12-15 10:55
 **/
@Controller
@RequestMapping("ajax")
public class AjaxController {

    @RequestMapping("/echart01")
    @ResponseBody
    public CommonResult echart01(){
        List<String> xlist=new ArrayList<String>();
        xlist.add("洗发水");
        xlist.add("沐浴露");
        xlist.add("脱发膏");
        xlist.add("洗面奶");
        xlist.add("剃须刀");

        List<Integer> ylist=new ArrayList<Integer>();
        ylist.add(9);
        ylist.add(19);
        ylist.add(17);
        ylist.add(97);
        ylist.add(37);
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("xdata",xlist);
        map.put("ydata",ylist);

        return new CommonResult(2000,"成功",map);

    }
}







